﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace QuestionsAnswers.UI.Models
{
    public class User
    {
        public int UserId { get; set; }
        public  String UserName { get; set; }
        public virtual List<Question> Questions { get; set; }
        public virtual List<Answer> Answers { get; set; }
        public virtual List<Course> Created { get; set; }
        public virtual List<Course> Participating { get; set; }
        public virtual List<Course> Owning { get; set; }
        public virtual List<Invitation> Invited { get; set; }
        public virtual List<Invitation> InvitedTo { get; set; }
        public virtual List<AssignedToUser> AssignedToUsers { get; set; }

        public virtual IEnumerable<Course> GetAllCourses()
        {
            var courses = new List<Course>();
            courses.AddRange(Participating);
            courses.AddRange(Owning);
            courses.AddRange(Created);
            return courses;
        }
    }

}
